package org.whatever.aha.zjut.platform.mapper.competition;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.whatever.aha.zjut.platform.entity.competition.AcademyCompetition;

import java.util.List;

/**
 * @author Vc
 * @version 1.0
 * @Desc
 * @date 2021/08/30 20:35
 */
public interface AcademyCompetitionMapper extends BaseMapper<AcademyCompetition> {

//    @Select("SELECT sum(ac.academy_province_rec_amt) FROM " +
//            "(SELECT academy_province_rec_amt,stage_id FROM academy_competition) as ac " +
//            "INNER JOIN " +
//            "(SELECT stage_id FROM competition_stage WHERE comp_id = #{compId}) as cs " +
//            "ON ac.stage_id = cs.stage_id")
    @Select("SELECT sum(academy_province_rec_amt) FROM academy_competition WHERE stage_id = #{stageId} ")
    Integer getDirectProvinceRecNum(@Param("stageId")int stageId);

}
